package xyz.yuzegod.megawalls.classes;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import xyz.yuzegod.megawalls.game.GamePlayer;
import xyz.yuzegod.megawalls.stats.KitStatsContainer;

import java.util.List;

public abstract class EquipmentPackage implements Upgradeable
{
    private Classes classes;
    
    public EquipmentPackage(final Classes classes) {
        this.classes = classes;
    }
    
    @Override
    public String getName() {
        return "职业套装";
    }
    
    @Override
    public int maxedLevel() {
        return 5;
    }
    
    @Override
    public double getAttribute(final int level) {
        return 0.0;
    }
    
    @Override
    public void upgrade(final GamePlayer gamePlayer) {
        final KitStatsContainer kitStats = gamePlayer.getPlayerStats().getKitStats(this.getClasses());
        kitStats.addEquipLevel();
        kitStats.updateInventory(null);
    }
    
    @Override
    public int getPlayerLevel(final GamePlayer gamePlayer) {
        return gamePlayer.getPlayerStats().getKitStats(this.getClasses()).getEquipLevel();
    }
    
    @Override
    public Material getIconType() {
        return this.getClasses().getIconType();
    }
    
    @Override
    public byte getIconData() {
        return this.getClasses().getIconData();
    }
    
    @Override
    public int getCost(final int level) {
        switch (level) {
            case 2: {
                return 500;
            }
            case 3: {
                return 2000;
            }
            case 4: {
                return 7000;
            }
            case 5: {
                return 15000;
            }
            default: {
                return 999999;
            }
        }
    }
    
    public abstract List<ItemStack> getEquipments(final int p0);
    
    public Classes getClasses() {
        return this.classes;
    }
}
